using System;

namespace TimeToGo.Formatters
{
    public class BinaryDurationFormatter : DurationFormatterBase
    {
        public BinaryDurationFormatter(string formatString)
            : base(formatString)
        { }

        public override string Name
        {
            get { return "Binary"; }
        }

        protected override string FormatDuration(TimeSpan duration)
        {
            return string.Format(FormatString, Convert.ToString((long)duration.TotalSeconds, 2));
        }
    }
}